/**
 * 系统设置权限设置添加管理员
 */
import './index.less'
import tem from './index.html'
import $_fn from '~plugins'
class backlogCtrl {
  constructor($scope,$rootScope,http,$ui) {
  	  console.log($scope.params)
      $scope.cancel = function () {
          $rootScope.$uiDirectiveModal.close() //关闭方法
      }
      //待办事项信息请求
      $scope.daiBan=function(){
      	console.log('待办信息');
      	http.post('consoleMessage.do',{},function (data) {
      			console.log(data)
				if(data.errcode==1){
					$ui.toast({
						text:data.errmsg,
						type:'succeed',
						appendTo:'.backlog'
					})
					$scope.param1=data.data;
					$scope.$apply()
				}else{
					$ui.toast({
						text:data.errmsg,
						type:'warning',
						appendTo:'.backlog'
					})
				}
	        },function(_data){
	            console.log(_data);//报错
	      	})
      }
     $scope.daiBan()
  	//添加管理员提交
  	 /* $scope.tiJiao1=function(){
	  	  	if(!$scope.param1.content){
	  	  		$ui.toast({
					text:'请输入备注',
					type:'warning',
					appendTo:'.backlog'
				})
	  	  		return 
	  	  	}
  	  		http.post('insertTracelogs.do',$scope.param1,function (data) {
				if(data.errcode==1){
					$ui.toast({
						text:data.errmsg,
						type:'succeed',
						appendTo:'.backlog'
					})
					$scope.log();//返回跟踪日志弹窗
				}else{
					$ui.toast({
						text:data.errmsg,
						type:'warning',
						appendTo:'.backlog'
					})
				}
	        },function(_data){
	            console.log(_data);//报错
	      	})
  	  }*/
  }
}
backlogCtrl.$inject = ['$scope','$rootScope','http','$ui']
module.exports = angular.module('directive.backlog', []).directive('backlog', function() {
    return {
        template: tem,
        replace:true,
        controller: backlogCtrl,
        scope:{
        	params:"@"
        }
    }
}).name